package nl.tudelft.jpacman.npc.ghost;

import nl.tudelft.jpacman.board.Board;
import nl.tudelft.jpacman.board.BoardFactory;
import nl.tudelft.jpacman.board.Square;
import nl.tudelft.jpacman.board.Unit;
import nl.tudelft.jpacman.level.Level;
import nl.tudelft.jpacman.level.LevelFactory;
import nl.tudelft.jpacman.level.Player;
import nl.tudelft.jpacman.level.PlayerFactory;
import nl.tudelft.jpacman.points.PointCalculator;
import nl.tudelft.jpacman.points.PointCalculatorLoader;
import nl.tudelft.jpacman.sprite.PacManSprites;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;

public class ClydeTest {
    private PlayerFactory playerFactory;
    private PacManSprites pacManSprites;
    private GhostFactory ghostFactory;
    private BoardFactory boardFactory;
    private GhostMapParser ghostMapParser;
    private LevelFactory levelFactory;
    private Player player;
    private PointCalculator pointCalculator;
    private Clyde clyde;
    @BeforeAll
    void setup()
    {
        pacManSprites = new PacManSprites();
        playerFactory = new PlayerFactory(pacManSprites);
        ghostFactory = new GhostFactory(pacManSprites);
        boardFactory = new BoardFactory(pacManSprites);
        levelFactory = new LevelFactory(pacManSprites, ghostFactory, new PointCalculatorLoader().load());
        ghostMapParser = new GhostMapParser(levelFactory, boardFactory, ghostFactory);
        player = playerFactory.createPacMan();
    }
    @Test
    void test()
    {
        String[] g  = new String[3];
        g = new String[]{"############", "#P C#", "############"};
        char map[][] = new char[3][12];
        int x = 0, y = 0;
        for(int i = 0; i < 3; i++)
            for(int j = 0; j < 12; j++) {
                map[i][j] = g[i].charAt(j);
                if(map[i][j] == 'C')
                {
                    x = i;
                    y = j;
                }
            }
        Level level = ghostMapParser.parseMap(map);
        level.registerPlayer(player);
         Navigation.findUnitInBoard(Clyde.class, level.getBoard());
        
    }
}
